#!/bin/bash
# create mysql_login 账号密码路径
# mysql_config_editor set --login-path=mysql_login --host=127.0.0.1 --user=root --password
#
# crontab -e
# 0 */2 * * * sh /data/source/extinguisher/script/backdb.sh
# 0 6 * * * sh /data/source/extinguisher/script/clear-backdb.sh
backfile=/data/extinguisher/dbsql/extinguisher-prod-`date +'%Y%m%d%H%M'`.sql
echo "backfile=${backfile}"
mysqldump --login-path=mysql_login --single-transaction --set-gtid-purged=OFF --triggers --routines --events --dump-date --databases extinguisher > $backfile
